package com.lipl.base.qlexpress.demo;

import com.ql.util.express.DefaultContext;
import com.ql.util.express.ExpressRunner;

/**
 * @Auther: 15541
 * @Date: 2020/11/3 16:04
 * @Description:
 */
public class Test {
    public static void main(String args[]) throws Exception {
        QLDemo demo = new QLDemo();
        demo.initial();

        System.out.println(demo.hasPermission(new UserInfo(100,"xuannan",7),  "三星卖家 而且 已经开店"));
        System.out.println(demo.hasPermission(new UserInfo(101,"qianghui",8), "三星卖家 而且 已经开店"));
        System.out.println(demo.hasPermission(new UserInfo(100, "张三", 8), "三星卖家 and 已经开店"));
        System.out.println(demo.hasPermission(new UserInfo(100, "李四", 7), "三星卖家 and 已经开店"));

//        ExpressRunner runner = new ExpressRunner();
//        DefaultContext<String, Object> context = new DefaultContext<String, Object>();
//        context.put("a",1);
//        context.put("b",2);
//        context.put("c",3);
//        String express = "a+b*c";
//        Object r = runner.execute(express, context, null, true, false);
//        System.out.println(r);
    }
}

